package actions;

import org.salespointframework.core.Action;
import org.salespointframework.core.GateChangeTransition;
import org.salespointframework.core.SaleProcess;
import org.salespointframework.core.SalesPoint;
import org.salespointframework.core.UIGate;

/**
 * The Class CommitAction.
 */
public class CommitAction implements Action {

	/**
	 * Changes to the commit gate. Called by an action listener, such as an
	 * button. The attribues are setted by the action listener.
	 *
	 * @param saleProcess - current SaleProecess
	 * @param salePoint - current SalesPoint
	 * @throws Throwable the throwable
	 */
	public void doAction(SaleProcess saleProcess, SalesPoint salePoint)
			throws Throwable {
		UIGate currentGate = (UIGate) saleProcess.getCurrentGate();
		currentGate
				.setNextTransition(GateChangeTransition.CHANGE_TO_COMMIT_GATE);

	}

}
